package com.liaoban.app.widget;

import android.text.Editable;
import android.text.TextWatcher;

/**
 * Created by ybc on 2018/1/10 0010.
 *
 */

public class MyTextWatcher implements TextWatcher {
    private CallBack mCallBack;

    public MyTextWatcher(CallBack callBack) {
        mCallBack = callBack;
    }

    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void afterTextChanged(Editable editable) {
        if(mCallBack != null) {
            mCallBack.changed();
        }
    }

    public interface CallBack {
        public void changed();
    }
}
